package com.cssw.fyzb.web.controller;


import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.core.model.dodb.SysParam;
import com.cssw.fyzb.web.service.CmfUsersVideoService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.cssw.fyzb.web.service.SysParamService;
import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: zzf
 * @Date: 2020/12/4 09:53
 * @Description:
 */
@ApiModel("系统配置相关接口")
@RestController
@RequestMapping("/sysParam")
public class SysParamController {

    @Autowired
    private SysParamService sysParamService;

    @ApiOperation(value = "配置列表", response = AjaxData.class)
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public AjaxData list() {
        return sysParamService.list();
    }

    @ApiOperation(value = "修改配置", response = AjaxData.class)
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public AjaxData update(@RequestBody Map<String,String> param) {
        return sysParamService.update(param.get("paramCode"), param.get("paramValue"));
    }
}
